import matplotlib.pyplot as plt #导入pyplot模块

plt.rcParams['font.sans-serif'] = ['SimHei']  # 解决中文乱码问题
plt.rcParams['axes.unicode_minus'] = False  # 解决正负号乱码问题

date = ['5/14', '5/15', '5/16', '5/17', '5/18', '5/19', '5/20',
        '5/21', '5/22', '5/23', '5/24', '5/25', '5/26', '5/27', '5/28']
max_temps = [32, 31, 29, 30, 29, 30, 29, 33, 31, 31, 26, 31, 26, 31, 28]
min_temps = [23, 24, 23, 23, 25, 25, 26, 24, 23, 23, 20, 23, 20, 23, 21]
plt.figure(figsize=(16, 4), dpi=150)  # 定义画布尺寸和分辨率
plt.grid(linestyle=":", alpha=0.5)  # 添加画布网格
plt.xlabel("日期")  # 添加x轴标签
plt.ylabel("温度（单位：℃）")  # 添加y轴标签
plt.title("清远市5月中旬每日最高/最低温度")  # 添加图表标题
plt.plot(date, max_temps, color="r", label="最高温度")  # 绘制最高温度折线图
plt.plot(date, min_temps, color="b", label="最低温度")  # 绘制最低温度折线图
plt.legend()
plt.savefig("")
plt.show()
